Skip to content

fix(app-shell): the Diagnostics page inside a package's Studio area sweeps only that package - #29230

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-0at9jd
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-0at9jd

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29179

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:Studio「全部元数据」区里,某个包内的诊断页现在只扫描这个包,和旁边的目录页一致;跨包入口(~all)和 Setup 的诊断页保持全环境扫描不变。
  • 为什么改:作者在包 A 里看到目录说「没有问题」,诊断页却列出别的包的无效项,点进去还跳到一个无关页面,无法找到要修的东西。
  • 风险与回滚:风险低,只多传一个包参数给已有的诊断请求(服务器早已支持按包过滤,目录页一直这样用);回滚即还原 DiagnosticsPage.tsx 一处改动。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.tsx(读取区域宿主并传 packageId 那一段);DiagnosticsPage.packageScope-29179.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/DiagnosticsPage.packageScope-29179.test.tsx,预期 5 个用例全绿(在 main 上其中 3 个红)。
  • 需要你做的:无,席位落地。

What changes

MetadataDiagnosticsPage now reads the Studio area host (useMetadataAreaHost()) and passes host.packageId to useGlobalDiagnostics when the area is open on a package, the way DirectoryPage passes its activePackage. The request becomes GET /api/v1/meta/diagnostics?severity=…&package=PKG, so the page's count matches the directory's and every listed row is an item of the open package, whose area-relative link (../TYPE/NAME) opens that item in its own package's area.

Unchanged: the cross-package leg (/studio/~all/metadata/_diagnostics, packageId: null) and Setup's page (no area host) keep the environment-wide sweep (#28561). No copy, i18n key or exported type changes.

Why

Inside com.example.showcase's area the directory's scoped sweep found 0 issues (no "View all issues" link), while the Diagnostics page's unscoped sweep listed pkga_qa_obj.qa_diag_view, another package's item; its link resolved into the showcase area and landed on an unrelated Interfaces page. The server already filters the sweep by packageId at its list read, and diagnostics entries carry no package, so scoping the request is the whole fix.

Tests

New DiagnosticsPage.packageScope-29179.test.tsx runs the real useGlobalDiagnostics against a fake client that answers as the server does (a packageId narrows the sweep), with the page nested at ROOT/_diagnostics as the area and Setup mount it:

  • a package's area: the request carries the package, another package's invalid item is not listed, the page reads "All clear" (the card's scenario);
  • a package's area: an own invalid item links to /studio/PKG/metadata/view/NAME;
  • switching to Errors + Warnings keeps the package scope;
  • the ~all leg and Setup keep the environment-wide request and list the foreign row (preservation pins).
Red on main (ea150b7), green on the fix

On ea150b7f with the test file alone: Tests 3 failed | 2 passed (5), the three package-area cases failing with expected [ { severity: 'error' } ] to deeply equal [ { severity: 'error', …(1) } ], expected the foreign row's anchor element to be null and expected { severity: 'warning' } to deeply equal { severity: 'warning', …(1) }. The two preservation cases pass on main by design.

On the fix (18d2b4cb), with the two existing Diagnostics page tests: Test Files 3 passed (3) · Tests 12 passed (12).

Acceptance notes

  • Setup's directory links ./_diagnostics without its ?package=, so Setup's Diagnostics page stays environment-wide beside a package-scoped directory count. This is outside the card's Studio reach and is left as is (noted, not fixed).
  • Ablation: the red-on-main run above is the before leg (the same test against the unfixed page, imported from source, so no dist rebuild is involved).

Verification

All readings on head 4cfc9074 (the fix merged with origin/main 104cd1a) unless stated.

Derived gates: 34 derived, 34 run, 0 NOT-MEASURED

node scripts/pm/dispatch-gates.mjs --commands derived 34 commands; the 33 unlocked ones each exit 0 in one loop, and pnpm --dir ui exec vitest run scripts/ ran under the lock: Test Files 169 passed | 2 skipped (171) · Tests 4900 passed | 2 skipped (4902), VERDICT command-exit 0. node scripts/check-sdui-manifest.mjs exit 0. dispatch-gates --ran: "34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED". pnpm check:new-line-citations (from ui/): 0 new citation(s).

Type-check and related tests
  • pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2: Tasks: 65 successful, 65 total, VERDICT command-exit 0.
  • The 19 test files that name DiagnosticsPage / MetadataDiagnosticsPage (git grep -l under ui/packages and ui/apps) plus the three metadataAreaHost.* tests (22 files): Test Files 22 passed (22) · Tests 294 passed (294). The rest of app-shell is left to CI's Test UI (declared narrowing).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (repo-wide lint is CI's)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…nly that package

The page asked for the environment-wide sweep even inside one package's
Studio "All metadata" area, while the directory beside it is scoped, so
another package's invalid item was listed there and its area-relative link
opened an unrelated page. It now reads the area host and sends the
package; the cross-package leg and Setup keep the environment-wide sweep.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jV7MUKsme1kh4FsABc
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu

席位核对 · ACCEPT · 2026-11-02T10:09Z

Head-sha: 4cfc9074b11fdaee59cd18ff3a7e2dbb172cd0a1

  • Shape:
    • The PR is a draft against main. The first card line is Fixes #29179, under claim 6573527798.
    • 3 files, +178 / −1: DiagnosticsPage.tsx, one new test and a root changeset. That is the claimed surface. check-governed-merges --pr 29230: 179 changed lines, under the human-merge threshold.
    • Clause-②: no and Metadata-protocol: none start their lines in the body and the changeset, as claimed. No export, string or type changes. The changeset is patch.
  • Read in the diff: the page reads useMetadataAreaHost() and passes host?.packageId ?? undefined to useGlobalDiagnostics. Inside a package's area the sweep is scoped to that package, as the directory beside it is. The ~all leg (packageId: null) and Setup (no host) both reach undefined, so they keep the environment-wide sweep.
  • Gates (check-runs on this head): 44 success, 11 skipped, 0 failed or pending. mergeable_state is clean.
  • Tests (dev): the new file reads 3 failed and 2 passed on ea150b7f; the two preservation pins pass by design. On this head: app-shell type-check 65 of 65, and 22 related files with 294 tests. Derived gates 34 of 34.
  • NOT MEASURED: the seat ran no live session.
  • Findings: Setup's directory link ./_diagnostics drops ?package=, so Setup's diagnostics page stays environment-wide beside a scoped directory count. It is outside the card's Studio reach and recorded in the PR's acceptance notes, not filed.
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Fixes #29179 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 10:10
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 2, 2026 10:10
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 8f0d838 Nov 2, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0at9jd branch November 2, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant